# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-ropgadget
_pkgname=ROPgadget
pkgver=5.9
pkgrel=1
pkgdesc='Pythonic argument parser, that will make you smile.'
groups=('blackarch' 'blackarch-exploitation')
url='https://pypi.org/project/ropgadget/#files'
arch=('any')
license=('GPL2')
depends=('python2' 'python2-capstone')
makedepends=('python2-setuptools')
source=("https://github.com/JonathanSalwan/ROPgadget/archive/v$pkgver.tar.gz")
sha512sums=('8eed7345787dcafea58950c1f4100eee5ec2fa02854fb50cb319f9de6abf5dad4dc21a5f3b055b8082d0718f5f0023993288321d8f1daa074bf7c899dd482b7e')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  mv "$pkgdir/usr/bin/$_pkgname" "$pkgdir/usr/bin/${_pkgname}2"
}

